home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////
- // ObjectArrayEditor
- // by Charles Lloyd
- ////////////////////////
-
-
- //////////////////////////
- // User Settable Items
- //////////////////////////
- persistent id localKeyArray;
- persistent id localLabelArray;
- persistent id localObjectArray;
- persistent id localColumnWidthArray;
-
- //////////////////////
- // Internal State
- //////////////////////
- persistent id isEditable;
- persistent id editableString;
-
- persistent id cellPadding;
-
- - awake
- {
- id aLocalObject;
-
- if (!localObjectArray) {
- localObjectArray = [NSMutableArray array];
- localKeyArray = @(
- "Title",
- "First Name",
- "Last Name",
- "Street",
- "City",
- "State",
- "Zip"
- );
- aLocalObject = @{
- "Title" = "Mr";
- "First Name" = "Joseph";
- "Last Name" = "Bleaux";
- "Street" = "123 Maple";
- "City" = "Reno";
- "State" = "NV";
- "Zip" = "89444";
- };
- aLocalObject = [[aLocalObject mutableCopy] autorelease];
- [localObjectArray addObject:aLocalObject];
-
- aLocalObject = @{
- "Title" = "Ms";
- "First Name" = "Jenny";
- "Last Name" = "McCarthy";
- "Street" = "12337 Sepulvada Blvd";
- "City" = "Los Angeles";
- "State" = "CA";
- "Zip" = "90210";
- };
- aLocalObject = [[aLocalObject mutableCopy] autorelease];
- [localObjectArray addObject:aLocalObject];
-
- aLocalObject = @{
- "Title" = "Dr";
- "First Name" = "Albert";
- "Last Name" = "Einstein";
- "Street" = "3.1428 E. MC Square";
- "City" = "Princeton";
- "State" = "NJ";
- "Zip" = "10134";
- };
- aLocalObject = [[aLocalObject mutableCopy] autorelease];
- [localObjectArray addObject:aLocalObject];
-
- localLabelArray = localKeyArray;
- localColumnWidthArray = @(4, 10, 10, 20, 20, 4, 7);
- isEditable = NO;
- [self toggleEditable];
- }
- }
-
- - processForm
- {
- return self;
- }
-
-
- - toggleEditable
- {
- if (isEditable == YES) {
- isEditable = NO;
- editableString = @"Make Editable";
- cellPadding = 4;
- } else {
- isEditable = YES;
- editableString = @"Make Read Only";
- cellPadding = 0;
- }
- }
-